package HibernateOrderManagerment.bean;

import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import javax.persistence.Table;

@Table(name="goods")
@Entity
public class Goods {
    @Id
    @Column(name="id")
	private long id;
    @Column(name="type")
	private String type;
	@Column(name="name")
	private String name ;
	@OneToMany
	@JoinColumn(name="goods_id")
	private Set<StoreGoods> storeGoods;
	public Set<StoreGoods> getStoreGoods() {
		return storeGoods;
	}

	public void setStoreGoods(Set<StoreGoods> storeGoods) {
		this.storeGoods = storeGoods;
	}

	public Goods(){
		id=-1;
	}

	public long getId() {
		return id;
	}

	public void setId(long id) {
		this.id = id;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Override
	public String toString() {
		return "Goods [id=" + id + ", type=" + type + ", name=" + name + "]";
	}
	
}
